﻿using System.ComponentModel;

namespace Sayook.Framework.DbCore.SqlModel
{
    /// <summary>
    /// SQL WHERE 子句 运算符
    /// </summary>
    public enum SqlOperator
    {
        /// <summary>
        ///  等于
        /// </summary>
        [Description(" {0} = {1} ")]
        Equal,

        /// <summary>
        ///  不等于
        ///  谨慎使用 不等于 操作符，引擎将放弃使用索引而进行全表扫描
        /// </summary>
        [Description(" {0} <> {1} ")]
        Unqual,

        /// <summary>
        ///  大于
        /// </summary>
        [Description(" {0} > {1} ")]
        Great,

        /// <summary>
        ///  小于
        /// </summary>
        [Description(" {0} < {1} ")]
        Less,

        /// <summary>
        ///  大于等于
        /// </summary>
        [Description(" {0} >= {1} ")]
        GreatOrEqual,

        /// <summary>
        ///  小于等于
        /// </summary>
        [Description(" {0} <= {1} ")]
        LessOrEqual,

        /// <summary>
        /// 全匹配 %LIKE%
        /// 谨慎使用 LIKE,将会导致引擎放弃使用索引而进行全表扫描
        /// </summary>
        [Description(" {0} LIKE '%{1}%' ")]
        Like,

        /// <summary>
        /// 右匹配 LIKE%
        /// </summary>
        [Description(" {0} LIKE '{1}%' ")]
        RightLike,

        /// <summary>
        /// 左匹配 %LIKE
        /// 谨慎使用 LIKE,将会导致引擎放弃使用索引而进行全表扫描
        /// </summary>
        [Description(" {0} LIKE '%{1}' ")]
        LeftLike,

        /// <summary>
        /// BETWEEN 操作
        /// </summary>
        [Description(" {0} BETWEEN '{1}' AND '{2}' ")]
        Between,

        /// <summary>
        /// In 操作
        /// 谨慎使用 IN,将会导致引擎放弃使用索引而进行全表扫描
        /// 对于连续的数值,可选用 BETWEEN
        /// </summary>
        [Description(" {0} IN ('{1}') ")]
        In,

        /// <summary>
        /// NotIn 操作
        /// 谨慎使用 NOTIN,将会导致引擎放弃使用索引而进行全表扫描
        /// </summary>
        [Description(" {0} NOT IN ('{1}') ")]
        NotIn,
    }
}